home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #1 / Amiga Plus CD - 2000 - No. 1.iso / Tools / Dev / Sas-PPC / samplelib2 / testppc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-12-03  |  795 b   |  42 lines

  1. #include <proto/dos.h>
  2. #include <proto/exec.h>
  3.  
  4. extern int _b;  /* this will be resolved to the definition of 'b' */
  5.                 /* from the 68k compiler */
  6.  
  7. test1(void)
  8. {
  9.     struct DOSLibrary *DOSBase;
  10.     void *SysBase = *(void **)4;
  11.  
  12.     DOSBase = OpenLibrary("dos.library", 0);
  13.     if (DOSBase)
  14.     {
  15.         Write(Output(), "in test1\n", 9);
  16.         CloseLibrary(DOSBase);
  17.     }
  18.     return(_b);
  19. }
  20.  
  21. test2(int a)
  22. {
  23.     struct DOSLibrary *DOSBase;
  24.     void *SysBase = *(void **)4;
  25.     
  26.     DOSBase = OpenLibrary("dos.library", 0);
  27.     if (DOSBase)
  28.     {
  29.         Write(Output(), "in test2\n", 9);
  30.         CloseLibrary(DOSBase);
  31.     }
  32.     _b = a;
  33.     return(_b);
  34. }
  35.  
  36.  
  37.  
  38.  
  39. /* These are so the 68k can access these functions */
  40. int (*__PPC_test1)(void) = test1;
  41. int (*__PPC_test2)(int) = test2;
  42.